package cn.itrip.dao.hotel.order;

import cn.itrip.beans.pojo.ItripHotelOrder;
import cn.itrip.beans.pojo.ItripOrderLinkUser;

import java.util.Date;
import java.util.List;

public interface OderMapper {

    /**
    * 创建订单
    **/
    public ItripOrderLinkUser createOrder(int userId,int orderType,String orderNo,String tradeNo,
                                          int hotelId,String HotelName,int roomId,int count,int bookingDays,
                                          Date checkInDate,Date checkOutDate,int orderStatus,double payAmount,
                                          String noticePhone,String noticeEmail,String specialRequirement,
                                          int isNeedInvoice,int invoiceType,String invoiceHead,String linkUserName,
                                          int bookType,Date creationDate,int createdBy);

    /**
     * 依据用户id查询订单
     * @param userId
     * @return
     */
    public  List<ItripHotelOrder> getOrderByUserId(int userId);

    /**
     * 根据用户id查找订单金额
     * @param userId
     * @return
     */
    public double getOrderPayAmount(int userId);


    /**
     * 订单删除
     * 根据订单编号删除
     */
    public void deleteOrderById(int id);

    /**
     * 根据酒店id查找酒店内的订单列表
     */
    public List<ItripHotelOrder> getOrderListByHotelId(int id);

    /**
     * 根据用户id查找用户订单列表
     * @param id
     * @return
     */
    public List<ItripOrderLinkUser> getOrderListByUserId(int id);

    /**
     * 根据订单状态查找酒店内订单列表
     */
    public List<ItripHotelOrder> getOrderListByHotelId(int id,int orderStatus);

    /**
     * 更新订单支付信息
     * @param id 订单id
     * @param status 状态
     */
    public void modifyOrder(int id,int status);

    /**
     * 根据用户id查找用户未支付的订单
     * @param userId
     * @return
     */
    public List<ItripHotelOrder> getOrderListToPayByUserId(int userId);


    /**
     * 通过微信支付
     * @param userId 用户id
     */
    public void payByWeChat(int userId);

    /**
     * 通过支付宝支付
     * @param userId 用户id
     */
    public void payByAliPay(int userId);

    /**
     * 线下支付（现金支付）
     * @param userId 用户id
     */
    public void payByCash(int userId);

    /**
     * 支付订单
     * @param userId 用户id
     * @param payType 支付类型
     */
    public void pay(int userId,int payType);


    public void changeOrder(int userId,int orderType,String orderNo,String tradeNo,
                            int hotelId,String HotelName,int roomId,int count,int bookingDays,
                            Date checkInDate,Date checkOutDate,int orderStatus,double payAmount,
                            int payType,String noticePhone,String noticeEmail,String specialRequirement,
                            int isNeedInvoice,int invoiceType,String invoiceHead,String linkUserName,
                            int bookType,Date modifyDate,int modifiedBy);
}
